﻿<?php
require('configs/include.php');

class c_moduleInclude extends super_controller {

    public function display() {

        $options['modulo']['lvl2'] = "all";
        $options['kernel']['lvl2'] = "by_state";
        $this->orm->connect();
        $this->orm->read_data(array("modulo", "kernel"), $options);
        $modulos = $this->orm->get_objects("modulo");
        $kernels = $this->orm->get_objects("kernel");
        $this->orm->close();
        $this->engine->assign('modulos', $modulos);
        $this->engine->assign('kernels', $kernels);
        $this->engine->assign('ubicationPath', $this->gvar['n_module']);
        $this->engine->display('header.tpl');
        $this->engine->display('moduleInclude.tpl');
        $this->engine->display('footer.tpl');
    }

    public function run() {
        if ($_SESSION['usuario']['tipo'] == "lider") {
            $this->display();
        } else {
            $this->engine->display('header.tpl');
            $this->engine->display('sinPermisos.tpl');
            $this->engine->display('footer.tpl');
        }
    }

}

$call = new c_moduleInclude();
$call->run();
?>